# http://www.cmake.org/cmake/help/examples.html

cmake_minimum_required(VERSION 2.8)

project (CPPCMSTUTORIAL)



#add_custom_command(
#   OUTPUT ${CMAKE_SOURCE_DIR}/src/my_skin.cpp
#   COMMAND cppcms_tmpl_cc ${CMAKE_SOURCE_DIR}/src/my_skin.tmpl -o ${CMAKE_SOURCE_DIR}/src/my_skin.cpp
#   DEPENDS src/my_skin.tmpl
#)

set(TEMPLATES src/my_skin.tmpl)  

#add_custom_command(  
#   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/my_skin.cpp  
#   COMMAND cppcms_tmpl_cc ${TEMPLATES} -o ${CMAKE_CURRENT_BINARY_DIR}/my_skin.cpp ${TEMPLATES}  
#   DEPENDS ${TEMPLATES}
#)
add_custom_command(  
   OUTPUT ${CMAKE_SOURCE_DIR}/src/my_skin.cpp  
   COMMAND cppcms_tmpl_cc ${TEMPLATES} -o ${CMAKE_SOURCE_DIR}/src/my_skin.cpp
   DEPENDS ${TEMPLATES}
)
   

AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/src CPP_LIST)
add_executable(cppcms_tutorial ${CPP_LIST} src/my_skin.cpp )

#add_executable (cppcms_tutorial main.cpp)


target_link_libraries (cppcms_tutorial cppcms) 
